//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package messages;

import common.ByteStream;
import common.LogicLong;
import common.RoadsideShop;
import common.Utils;
import common.decompressedData;

import java.util.LinkedHashMap;

public class VisitedGregData extends Base {
    public static final int MsgType = 24115;
    private Long homeId;
    private Long accountId;
    private LinkedHashMap<Integer, Integer> homeInventory = new LinkedHashMap();
    private RoadsideShop homeShop;
    private String homeData = new String();

    public VisitedGregData() {
        super(24115);
    }

    public void encode(ByteStream stream) {
    }

    public void decode(ByteStream stream) {
        LogicLong t = new LogicLong();
        t.decode(stream);
        this.accountId = Long.valueOf(t.longValue());
        t.decode(stream);
        this.homeId = Long.valueOf(t.longValue());
        int itemslen = stream.readShort();

        int numslots;
        for(numslots = 0; numslots < itemslen; ++numslots) {
            int d = stream.readInt();
            int value = stream.readInt();
            this.homeInventory.put(Integer.valueOf(d), Integer.valueOf(value));
        }

        stream.skip(274);
        numslots = stream.readInt();
        if(numslots >= 0) {
            this.homeShop = new RoadsideShop(numslots);
            this.homeShop.decode(stream);
        }

        decompressedData var7 = Utils.tryToDecompressData(stream.getUnreadBytes());
        if(var7.resultString.length() > 0) {
            this.homeData = var7.resultString;
        }

        this.isDecoded = true;
    }

    public Long getHomeId() {
        return this.homeId;
    }

    public RoadsideShop getHomeShop() {
        return this.homeShop;
    }

    public LinkedHashMap<Integer, Integer> getHomeInventory() {
        return this.homeInventory;
    }
}
